//
//  BaseRoutingDelegate.m
//  Masonry
//
//  Created by Sings on 2019/8/13.
//

#import "BaseRoutingDelegate.h"
#import "BaseRegisterModel.h"

@implementation BaseRoutingDelegate


static BaseRoutingDelegate *_baseRoutingDelegate = nil;

+ (instancetype)sharedInstance {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _baseRoutingDelegate = [[super allocWithZone:NULL] init];
        [_baseRoutingDelegate registerRouting];
    });
    
    return _baseRoutingDelegate;
}

+ (instancetype) allocWithZone:(struct _NSZone *)zone {
    return [BaseRoutingDelegate sharedInstance];
}

- (id)copyWithZone:(NSZone *)zone {
    return _baseRoutingDelegate;
}

- (id)mutableCopy {
    return _baseRoutingDelegate;
}

- (void) registerRouting {
    [[BaseRegisterModel sharedInstance] registerTableHeaderFooterRouting:[self mdicTableHeaderFooterRouting]];
    [[BaseRegisterModel sharedInstance] registerCollectionHeaderFooterRouting:[self mdicCollectionHeaderFooterRouting]];
}

- (NSMutableDictionary *) mdicTableHeaderFooterRouting {
    NSDictionary *dic = @{
                          @"TableViewMinHeaderFooterViewModel" : @"TableViewMinHeaderFooterView",
                          };
    NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:dic];
    return dict;
}


- (NSMutableDictionary *) mdicCollectionHeaderFooterRouting {
    NSDictionary *dic = @{
                          @"CollectionViewMinHeaderFooterViewModel" : @"CollectionMinHeaderFooterView",
                          };
    NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:dic];
    return dict;
}

@end
